bitkeeper revision 1.1159.17.19 (411b929cWqTc_xtMch0ol_CgtZ8PJQ)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Thu, 12 Aug 2004 15:54:04 +0000 (15:54 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Thu, 12 Aug 2004 15:54:04 +0000 (15:54 +0000)
Merge 2.4 and 2.6 reboot code.

linux-2.4.26-xen-sparse/arch/xen/kernel/Makefile
linux-2.4.26-xen-sparse/arch/xen/kernel/process.c
linux-2.4.26-xen-sparse/mkbuildtree
linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c

index 000e40934f7e2e0d972e01f3eb0092d076d2e839..2d669c8f9edadf273fcc4f4e70104e0014084c6a 100644 (file)
@@ -10,7 +10,8 @@ export-objs     := i386_ksyms.o
 
 obj-y  := process.o semaphore.o signal.o entry.o traps.o irq.o  \
                ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o \
-               i386_ksyms.o i387.o evtchn.o ctrl_if.o pci-dma.o
+               i386_ksyms.o i387.o evtchn.o ctrl_if.o pci-dma.o \
+               reboot.o
 
 ifdef CONFIG_PCI
 obj-y  += pci-i386.o pci-pc.o
index 56cabca2a9483c37ffd3c91ddc4c198b582d70db..d03acd64a1fe5fb9133de8ad00e035d8e977a057 100644 (file)
@@ -115,27 +115,6 @@ void cpu_idle (void)
     }
 }
 
-void machine_restart(char *__unused)
-{
-    /* We really want to get pending console data out before we die. */
-    extern void xencons_force_flush(void);
-    xencons_force_flush();
-    HYPERVISOR_reboot();
-}
-
-void machine_halt(void)
-{
-    machine_power_off();
-}
-
-void machine_power_off(void)
-{
-    /* We really want to get pending console data out before we die. */
-    extern void xencons_force_flush(void);
-    xencons_force_flush();
-    HYPERVISOR_shutdown();
-}
-
 extern void show_trace(unsigned long* esp);
 
 void show_regs(struct pt_regs * regs)
index 8396693b74d5c051d1d9dd2a67b78c2c67ad7c6d..870df2cfbf5ff488db08b0524979c56028397380 100755 (executable)
@@ -222,6 +222,7 @@ ln -sf ../../i386/kernel/semaphore.c
 ln -sf ../../i386/kernel/sys_i386.c 
 ln -sf ../../../${LINUX_26}/arch/xen/kernel/ctrl_if.c
 ln -sf ../../../${LINUX_26}/arch/xen/kernel/evtchn.c
+ln -sf ../../../${LINUX_26}/arch/xen/kernel/reboot.c
 ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/ioport.c
 ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/pci-dma.c
 
index 9b39412746f5d186d23fe790e5aca8fe124edbf5..f8c0f246cab11824fb620816ff145e0aa1af826a 100644 (file)
@@ -1,8 +1,12 @@
 
+#include <linux/version.h>
 #include <linux/module.h>
+#include <linux/reboot.h>
 #include <asm-xen/hypervisor.h>
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 int reboot_thru_bios = 0;      /* for dmi_scan.c */
+#endif
 
 void machine_restart(char * __unused)
 {
@@ -12,21 +16,18 @@ void machine_restart(char * __unused)
        HYPERVISOR_reboot();
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 EXPORT_SYMBOL(machine_restart);
+#endif
 
 void machine_halt(void)
 {
-       /* We really want to get pending console data out before we die. */
-       extern void xencons_force_flush(void);
-       xencons_force_flush();
-       for ( ; ; ) /* loop without wasting cpu cycles */
-       {
-               HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_pending = 0;
-               HYPERVISOR_block();
-       }
+       machine_power_off();
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 EXPORT_SYMBOL(machine_halt);
+#endif
 
 void machine_power_off(void)
 {
@@ -36,4 +37,6 @@ void machine_power_off(void)
        HYPERVISOR_shutdown();
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 EXPORT_SYMBOL(machine_power_off);
+#endif